import { defineComponent, h, useSlots } from 'vue'
import { Table } from 'ant-design-vue'
import { tableProps } from './interface'
import { initDefaultProps } from '@/utils/initDefaultProps'
import './index.scss'

const ZTable = defineComponent({
  name: 'ZTable',
  props: initDefaultProps(tableProps(), {
    rowKey: 'sid'
  }),
  setup(props) {
    const slots = useSlots()

    return () => {
      return h('div', { class: 'z-table' }, [h(Table, { ...(props as any) }, { ...slots })])
    }
  }
})

export default ZTable
